extends layout/default

block content
    style.
        form .icon {
            background-color: #999;
            color: #fff;
            width: 30px;
            text-align: center;
        }
    script.
        var __hn = '#{hotelNo}'

    if !isLogin
        #page-main.page
            header.bar.bar-nav
                h1.title 我的

            include include/nav
            .content
                .buttons-tab
                    a.tab-link.active.button(href='#tab1') 登录
                    a.tab-link.button(href='#tab2') 注册

                .content-block
                    .tabs
                        #tab1.tab.active
                            .list-block
                                form(action="/login?hn=#{hotelNo}", method="post", id='login-form')
                                    input(type='hidden',name='hotelno' value='#{hotelNo}')
                                    ul
                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-form-name
                                                .item-inner
                                                    .item-input
                                                        input(type="text", name="phone" ,placeholder="手机号" id="input-login-phone")
                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-form-password
                                                .item-inner
                                                    .item-input
                                                        input(type="password",name="password", placeholder="密码" id='input-login-password')
                                    .content-padded
                                        button.button.button-big.button-fill.button-success.width-100 提交

                        #tab2.tab
                            .list-block
                                form(action="/register?hn=#{hotelNo}", method="post" id='register-form')
                                    input(type='hidden',name='hotelno' value='#{hotelNo}')
                                    ul
                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-card
                                                .item-inner
                                                    .item-input
                                                        input(type="text", name='username', placeholder="用户名", id='input-reg-name')
                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-phone
                                                .item-inner
                                                    .item-input
                                                        input(type="text", name='phone', placeholder="手机号", id='input-reg-phone')
                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-code
                                                .item-inner
                                                    .item-input
                                                        input(type="number",name='yzm', placeholder="验证码", id='input-reg-yzm')
                                                    .item-after
                                                        a.js-get-yzm(data-target-phone-number='#input-reg-phone' data-url='/yzm?hn=#{hotelNo}') 获取验证码


                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-form-password
                                                .item-inner
                                                    .item-input
                                                        input(type="password", name="password" placeholder="密码" id='input-reg-password')

                                        li
                                            .item-content
                                                .item-media
                                                    i.icon.icon-form-password
                                                .item-inner
                                                    .item-input
                                                        input(type="password", name="repassword",placeholder="密码" id='input-reg-repassword')
                                    .content-padded
                                        button.button.button-big.button-fill.button-success.width-100 提交

    else
        #page-main.page
            header.bar.bar-nav
                h1.title 我的

            include include/nav
            .content
                .card
                    .card-content
                        .avatar.ta-c
                            i.icon.icon-me.fs-lll
                    .card-footer
                        a.link.width-100
                            .ta-c.width-100
                                | 会员 : #{phoneDisplay} 你好
                .list-block
                    ul
                        a.item-content.item-link(href="#page-order-list")
                            .item-media
                                i.icon.icon-cart
                            .item-inner
                                .item-title 我的订单
                        //a.item-content.item-link(href="#page-detail")
                        //    .item-media
                        //        i.icon.icon-edit
                        //    .item-inner
                        //        .item-title 我的点评
                    .content-padded
                        a.external(href='/logout?hn=#{hotelNo}') 退出登录

        #page-order-list.page
            header.bar.bar-nav
                a.button.button-link.button-nav.pull-left.back(href="#page-main")
                    span.icon.icon-left 返回
                h1.title 我的订单

            .content
                //还在进行中的订单
                each order in orderList
                    .card.order-item(data-order-num='#{order.orderNum}',data-order-code='#{order.commentCode}')
                        .card-content
                            .card-content-inner
                                .order-item
                                    .order-key 订单号
                                    .order-value #{order.orderNum}
                                .order-item
                                    .order-key 时间
                                    .order-value #{order.beginDate} 到</br>  #{order.endDate}
                                .order-item
                                    .order-key 房间
                                    .order-value #{order.rtName}（#{order.rmCount}}间
                                .order-item
                                    .order-key 价格
                                    .order-value #{order.price}元
                                .order-item
                                    .order-key 状态
                                    .order-value.color-warning #{order.status}

                        .card-footer.of-hidden
                            if order.zfCode=='0'
                                .action-item
                                    .button.button-fill.button-success.js-pay-order 支付
                            if order.selectRoomCode=='0'
                                .action-item
                                    .button.button-fill.button-success.js-select-room(
                                            data-order-num='#{order.orderNum}',data-rt-code='#{order.rtCode}',data-room-count='#{order.rmCount}') 选房
                            .action-item
                                .button.button-fill.button-danger.js-cancel-order 取消



                .content-block-title 历史订单
                    each order in historyOrderList
                        .card.order-item(data-order-num='#{order.orderNum}',data-order-code='#{order.commentCode}')
                            .card-content
                                .card-content-inner
                                    .order-item
                                        .order-key 订单号
                                        .order-value #{order.orderNum}
                                    .order-item
                                        .order-key 时间
                                        .order-value #{order.beginDate} 到</br>  #{order.endDate}
                                    .order-item
                                        .order-key 房间
                                        .order-value #{order.rtName}（#{order.rmCount}}间
                                    .order-item
                                        .order-key 价格
                                        .order-value #{order.price}元
                                    .order-item
                                        .order-key 状态
                                        .order-value.color-warning #{order.status}
                            if order.commentCode == '0' && order.statusCode == 3
                                .button.button-fill.btn-post-comment.width-100 进行评论

        #page-select-room.page
            header.bar.bar-nav
                a.button.button-link.button-nav.pull-left.back(href="#page-order-list")
                    span.icon.icon-left 返回
                h1.title 选房

            nav.bar.bar-tab
                .tab-item
                    a#submit-select-room.button.button-fill.button-big.width-100( style="border-radius: 0") 确定选房

            .content
                .content-block-title#select-room-count(style="margin-top: .75rem") 选择房间
                .list-block(style="margin: 0")
                    ul#select-room-list

block pageJs
    script(src=getStatic("ubooking/my/my.entry.js") )
block pageCss
    link(rel='stylesheet' href=getStatic('ubooking/my/my.entry.css'))


